<!doctype html>
<html lang="zh_CN">
	<head>
        {{template "header"}}
    </head>
    <body class="login-bg">
        <div class="login">
            <div class="message">Gobase管理系统登录</div>
            <div id="darkbannerwrap"></div>

            <form method="post" class="layui-form" action="/login/login">
                <input name="username" placeholder="用户名"  type="text" lay-verify="username" class="layui-input" >
                <hr class="hr20">
                <input name="password" lay-verify="password" placeholder="密码"  type="password" class="layui-input">
                <hr class="hr20">
                <input class="loginin" value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
                <hr class="hr20" >
            </form>
        </div>

        {{template "jsfile"}}
        <script type="text/javascript">
            layui.extend({
                admin: '/static/js/admin'
            });
            layui.use(['jquery','form','admin'], function(){
                var form = layui.form,
                admin = layui.admin,
                $=layui.jquery;

                form.verify({
                    username: function(value){
                        if(value.length <= 0){
                            return '用户名不允许为空！';
                        }
                    },
                    password: function(value){
                        if(value.length <= 0){
                            return '密码不允许为空!';
                        }
                    }
                })

                //监听提交
                form.on('submit(login)', function(data){
                    $.post("/login/login",data.field,function(result){
                        if(result.status){
                            location.replace("/index");
                        }else{
                            layer.msg(result.message);
                        }
                    },"json");
                    return false;
                });
            });
        </script>
        <!-- 底部结束 -->
    </body>
</html>